
package br.edu.unip.tcc.jogdadavelha.gui;

import br.edu.unip.tcc.jogdadavelha.*;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDletStateChangeException;

/**
 *
 * @author Fabricio V. Zamara
 */
public class TelaGanhou extends Form implements CommandListener {
    // tela que mostra o jogador ganhador
	private Displayable previous;

	public TelaGanhou(Displayable previous, String msg) {
		super(msg);

		this.previous = previous;
		this.setCommandListener(this);
		this.addCommand(new Command("Sair", Command.EXIT, 1));
		this.append(msg);
	}

	public void commandAction(Command arg0, Displayable arg1) {
        try {
            JogoVelhaMIDlet.getInstance().exitMIDlet();
        } catch (MIDletStateChangeException ex) {
            ex.printStackTrace();
        }
	}
}
